package mysql

import "gorm.io/gorm"

// User todo: 用户表
type User struct {
	gorm.Model
	Mobile   string `gorm:"type:varchar(11);not null"`
	Password string `gorm:"type:varchar(15);not null"`
	Name     string `gorm:"type:varchar(15)"`
	IdCard   string `gorm:"type:varchar(18)"`
}

// Goods todo: 商品表
type Goods struct {
	gorm.Model
	GoodsName    string  `gorm:"type:varchar(11);not null"`
	GoodsPrice   float64 `gorm:"type:decimal(15,2);not null"`
	GoodsStock   int     `gorm:"type:int(15)"`
	GoodsDetails string  `gorm:"type:varchar(30)"`
}

// Product todo: 预热表
type Product struct {
	gorm.Model
	GoodsName    string  `gorm:"type:varchar(11);not null"`
	GoodsPrice   float64 `gorm:"type:decimal(15,2);not null"`
	GoodsDetails string  `gorm:"type:varchar(30)"`
}

// Cart todo: 购物车表
type Cart struct {
	gorm.Model
	UserId int `gorm:"type:int(15);not null"`
}

// CartGoods todo: 购物车商品表
type CartGoods struct {
	gorm.Model
	CartId       int     `gorm:"type:int(15);not null"`
	GoodsName    string  `gorm:"type:varchar(11);not null"`
	GoodsPrice   float64 `gorm:"type:decimal(15,2);not null"`
	GoodsStock   int     `gorm:"type:int(15);not null"`
	GoodsDetails string  `gorm:"type:varchar(30);not null"`
}

// Order todo: 购物车商品表
type Order struct {
	gorm.Model
	UserId    int     `gorm:"type:int(15);not null"`
	UserSn    string  `gorm:"type:varchar(30);not null"`
	Money     float64 `gorm:"type:decimal(15,2);not null"`
	PayType   string  `gorm:"type:varchar(10);not null"`
	PayStatus string  `gorm:"type:varchar(10);not null"`
}
